/*
 * ChessController.cpp
 *
 *  Created on: Mar 30, 2011
 *      Author: cnwilson
 */

#include "../inc/ChessController.h"

	ChessController::ChessController(int arg) {
		gameName = NULL;
		turn =WHITE;

		if (arg==0){
			player1 = new HumanPlayer(&model);
			player2 = new HumanPlayer(&model);

		}
		else if(arg==1){
			player1 = new HumanPlayer(&model);
			player2 = new ComputerPlayer(&model);
		}
		else if(arg==2){
			player1 = new ComputerPlayer(&model);
			player2 = new HumanPlayer(&model);
		}
		else{
			player1 = new ComputerPlayer(&model);
			player2 = new ComputerPlayer(&model);
		}

//		string title("New Game");
//		string message("Please Select Player 1 Type");
//		std::vector labels;
//		labels.resize(2);
//		labels[0] = "Human";
//		labels[1]="Computer";
//
//		signed int selected = SelectDialog::SelectDialogRun(title,message,labels);
//		if (selected == 0) {
//			player1 = new HumanPlayer(&model);
//		} else
//			player1 = new ComputerPlayer(&model);
//
//		message = string("Please Select Player 2 Type");
//		signed int selected = SelectDialog::SelectDialogRun(title, message,
//				labels);
//		if (selected == 0) {
//			player2 = new HumanPlayer(&model);
//		} else
//			player2 = new ComputerPlayer(&model);
	}

	ChessController::~ChessController(){
		delete player1;
		delete player2;
	}
	void ChessController::on_CellSelected(int row, int col, int button){

	}
	void ChessController::on_DragStart(int row,int col){

	}
	bool ChessController::on_DragEnd(int row,int col){

	}
	void ChessController::on_NewGame(){

	}
	void ChessController::on_SaveGame(){

	}
	void ChessController::on_SaveGameAs(){

	}
	void ChessController::on_LoadGame(){

	}
	void ChessController::on_UndoMove(){

	}
	void ChessController::on_QuitGame(){

	}
	void ChessController::on_TimerEvent(){

	}
	void ChessController::SetView(IChessView* view){
		this->view=view;
	}
